package com.zhb.mybatis.dao;

import com.zhb.mybatis.beans.Employee;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @program: Mybatis
 * @description:
 * @author: rainboz
 * @create: 2019-09-12 15:02
 **/
public interface EmployeeMapper {
    //查 删 改 增
    public Employee getEmployeeById(Integer id);

    public Integer deleteEmployeeById(Integer id);

    public void updateEmployee(Employee employee);

    public void addEmployee(Employee employee);

    //多个参数
    public Employee getEmployeeByIdAndName(@Param("id") Integer id, @Param("lastName") String lastName);

    //封装Map
    public Employee getEmployeeByMap(Map<String, Object> map);

    //day02
    //2)查询多行数据返回对象的集合
    public List<Employee> getEmployeeList();

//    3)查询单行数据返回Map集合
    public Map<String,Object> getEmployeeByIdReturnMap(Integer id );

//    4)查询多行数据返回Map集合
    @MapKey("id") // 指定使用对象的哪个属性来充当map的key
    public Map<Integer,Employee>  getAllEmpsReturnMap();
}
